+2008-05-23 Hans Breuer <hans@breuer.org>
+
+ * gtk/gtkprintoperation.c : check surface status after ceating a pdf.
+ Avoids crashing when the target can not be written, bug #537685
+
+ * gdk/win32/gdkdisplay-win32.c : runtime linking of ProcessIdToSessionId
+
+ * gtk/gtkfilesystem.c : variadic macros are not supported with c89 and
+ it was not needed here anyway.
+
2008-06-13 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_frame): Fix frame size allocation.
DWORD session_id;
char *display_name;
static const char *display_name_cache = NULL;
+ typedef BOOL (* PFN_ProcessIdToSessionId) (DWORD, DWORD *);
+ PFN_ProcessIdToSessionId processIdToSessionId;
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
window_station_name = "WinSta0";
}
- if (!ProcessIdToSessionId (GetCurrentProcessId (), &session_id))
+ processIdToSessionId = (PFN_ProcessIdToSessionId) GetProcAddress (GetModuleHandle ("kernel32.dll"), "ProcessIdToSessionId");
+ if (!processIdToSessionId || !processIdToSessionId (GetCurrentProcessId (), &session_id))
session_id = 0;
display_name = g_strdup_printf ("%ld\\%s\\%s",
/* #define DEBUG_MODE */
#ifdef DEBUG_MODE
-#define DEBUG(x...) g_debug (x);
+#define DEBUG(x) g_debug (x);
#else
-#define DEBUG(x...)
+#define DEBUG(x)
#endif
#define GTK_FILE_SYSTEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), GTK_TYPE_FILE_SYSTEM, GtkFileSystemPrivate))
surface = cairo_pdf_surface_create (priv->export_filename,
width, height);
+ if (cairo_surface_status (surface) != CAIRO_STATUS_SUCCESS)
+ {
+ g_set_error (&priv->error,
+ GTK_PRINT_ERROR,
+ GTK_PRINT_ERROR_GENERAL,
+ cairo_status_to_string (cairo_surface_status (surface)));
+ *do_print = FALSE;
+ return GTK_PRINT_OPERATION_RESULT_ERROR;
+ }
+
+ /* this would crash on a nil surface */
cairo_surface_set_fallback_resolution (surface, 300, 300);
priv->platform_data = surface;